package com.stefanie.study.pp;

import lombok.Data;

/**
 * @author: stefanie-zy
 * @time: 2024/7/1-14:52
 * @description: 原型模式-克隆模式
 */
@Data
public class User implements Cloneable {

    // 属性
    private String name;
    private Integer age;
    private String address;

    @Override
    public User clone() {
        try {
            return (User) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new AssertionError();
        }
    }
}
